package com.atguigu.chaptar3

object $06_ObjectAndClass {
  def main(args: Array[String]): Unit = {
    Color.age
    val color = new Color
    color.age
//    println(Color.apply().age)
//    println(Color().age)
    println(Color().address)
    println(Color("loudi").address)
  }

}
object Color{
  private val weight = 20
  val age =30
  def sayHello()={
    val color = new Color
    color.name
  }

  def apply(): Color = new Color()
  def apply(address:String): Color = new Color(address)

}
class Color(val address:String){
  def this()=this("xixixixi")
  private val name = "huangse"
  val age = 100
  def haha()=Color.weight
}